1. Field of the Invention
This invention relates to an information processing system for reading data from a large-capacity storage unit through a data buffer and, for example, to a database system for processing a query on a database on a disk unit.
2. Description of the Related Art
The performance of a database system for processing queries on a database file on a disk unit is limited by the data transfer wait time from the disk unit rather than the processing capability of a central processing unit (CPU). Thus, various methods are designed, such as a method of providing a buffer for retaining disk blocks making up a file for decreasing the actual number of input/output times from/to a disk unit and a method of previously reading necessary disk blocks into memory.
FIG. 16 is a chart to show a file access control system shown on xe2x80x9cImplementation and performance of integrated applicationxe2x80x94controlled file caching, prefetching, and disk scheduling,xe2x80x9d an article appearing on pages 311 to 343 of issue 4 of vol. 14 of ACM Transactions on Computer Systems published in November 1996, for example
In FIG. 16, numerals 4a and 4b denote query processing tasks, numeral 6 denotes a disk unit for storing a file, numeral 71 denotes a disk input/output control module for performing physical input/output from/to the disk unit, numeral 91 denotes a preread module for reading a block from the disk unit prior to a request issued from the query processing task, and numeral 92 denotes a buffer module for retaining the block read from the disk unit on memory.
FIG. 17 is a timing chart to show a time sequence applied when the query processing task 4a executes query processing. In the figure, the horizontal axis represents the time. Numerals 40a and 60 represent a data processing sequence of the query processing task 4a and a data transfer sequence of the disk unit 6 respectively. Numerals B1 and B2 denote numbers of disk blocks and numerals t21, t22, t23, and t24 denote timings. Numeral 41a represents the time taken for the query processing task 4a to process one block read into the memory and numeral 61 represents the time taken for the disk unit 6 to transfer one block.
At timing t21, the query processing task 4a starts execution, notifies the preread module 91 of the accessed disk block order, B1, B2, . . . , and waits for the first block B1 to be read. The preread module 91 instructs the disk input/output control module 71 to read the first block B1 in accordance with the block order indicated from the query processing task 4a, and the disk unit 6 starts to transfer the block B1. At timing t22, the transfer of the block B1 from the disk unit is complete, the query processing task 4a processes the data in the block, the preread module 91 instructs the disk input/output control module 71 to read the second block B2, and the disk unit 6 starts to transfer the block B2.
At timing t23, upon completion of processing the block B1, the query processing task 4a waits for the second block B2 to be read. At timing t24, the transfer of the block B2 from the disk unit is complete, the query processing task 4a processes the data in the block, and the preread module 91 instructs the disk input/output control module 71 to read the next block. This processing is repeated until completion of processing all blocks in the file.
Thus, using the block access order indicated by the query processing task 4a, the preread module 91 can start block read without waiting for a block access request issued from the query processing task 4a, so that the wait time of the query processing task 4a can be made shorter than the block transfer time 61 of the disk unit 6 with respect to any other block than the first block B1.
In the file access system in the related art as described above, the disk block transfer order between the disk unit and the buffer can be changed, but the disk block transfer order between the buffer and the task cannot be changed. Thus, even if two or more tasks make sequential access to the same file at the same time, the disk block accessed at the same time is not necessarily the same. Thus, for a file larger than the buffer capacity, the possibility that the disk block accessed by one task may remain on the buffer until it is accessed by another task is low; the buffering effect cannot be produced.
It is therefore an object of the invention to provide an information processing system wherein a buffer can be used efficiently even if a plurality of query processing tasks access a large-capacity database file at the same time.
According to the invention, there is provided an information processing system comprising buffer storage means for temporarily storing a plurality of data pieces read from a storage unit, order determination means for detecting from a processing request for requesting a plurality of data pieces stored on the storage unit, the data piece matching the data stored in the buffer storage means among the data pieces requested in the processing request and determining the read order of the match data piece and the remaining data requested in the processing request so as to read the match data piece preceding the remaining data, and read means for reading the match data piece from the buffer storage means before reading the remaining data into the buffer storage means from the storage unit in accordance with the read order determined by the order determination means.
The storage unit is a disk unit, the read means reads the remaining data into the buffer storage means from the disk unit after reading the match data piece, and the information processing system further includes transmission means for transmitting the remaining data after transmitting the match data piece read by the read means from the buffer storage means.
According to the invention, there is provided an information processing system comprising a disk unit with a storage area divided into a plurality of blocks, buffer storage means for storing a plurality of blocks read from the disk unit, first processing means for accepting a first processing request for requesting a plurality of data pieces stored on the disk unit, detecting a plurality of blocks storing the data pieces requested in the first processing request based on the first processing request, and reading the data in the detected blocks from the buffer storage means, second processing means for accepting a second processing request for requesting a plurality of data pieces stored on the disk unit, detecting a plurality of blocks storing the data pieces requested in the second processing request based on the second processing request, and reading the data in the detected blocks from the buffer storage means, detection means for detecting a block common to the first and second processing requests among the blocks stored in the buffer storage means, and buffer management means, to erase the data contained in the common block detected by the detection means from the buffer storage means, for erasing the data after the data to be erased is read by both the first and second processing means.
The buffer management means comprises preread means for reading the data in the blocks detected by the first processing means and data in a block specified in a read request received from the outside from the disk unit and stores the read data in the buffer storage means, and the detection means specifies a block not common to the blocks related to the first processing request without specifying the common block among the blocks detected by the second processing means and outputs to the preread means as the read request.
The buffer storage means stores the data pieces requested in the first and second processing requests in a first-in first-out shared queue, the preread means stores the data in the common block read from the disk unit in the queue, the first processing means reads the data requested in the first processing request based on a first pointer for pointing to one location in a storage area of the queue, and the second processing means reads the data requested in the first processing request based on a second pointer for pointing to one location in the storage area of the queue.
According to the invention, there is provided an information processing system comprising buffer storage means for temporarily storing a plurality of common data pieces to a plurality of processing requests, read means for reading new data from a storage unit, and buffer management means for substituting the new data for the common data having been processed for the processing requests without substituting the new data for unprocessed common data having not yet been processed for at least one of the processing requests among the common data pieces stored in the buffer storage means.
The buffer management means stops writing into the buffer storage means if all common data pieces stored in the buffer storage means are unprocessed command data and an empty storage area is not available.
According to the invention, there is provided an information processing system comprising priority determination means for accepting a first processing request for requesting data and a second processing request for requesting a smaller amount of data than that in the first processing request and assigning a high priority to the second processing request involving a smaller data amount between the first and second processing requests and a lower priority than that of the second processing request to the first processing request involving a larger data amount as compared with the second processing request based on the data amounts of the data requested in the first and second processing requests, and read means for reading the data in the processing request assigned the high priority from a storage unit taking precedence over data in any other processing request based on the priorities.
The priority determination means determines the priority of the first processing request based on a predetermined data amount and the data amount involved in the first processing request and the priority of the second processing request based on the predetermined data amount and the data amount involved in the second processing request.
If the priority determination means accepts the second processing request later while the read means reads the first processing request, it again determines the priorities from the beginning, and the read means interrupts reading of the data requested in the first processing request and reads the data requested in the second processing request based on the priorities again determined by the priority determination means, and restarts reading of the data requested in the first processing request after completion of reading the data requested in the second processing request.
The first and second processing requests are requests for accessing different files, and the read means reads the file related to the first processing request and the file related to the second processing request based on the priorities.
According to the invention, there is provided a recording medium recording a program for causing a computer to execute the acceptance step of accepting a processing request for requesting a plurality of data pieces on a storage unit, the determination step of determining whether or not data matching the data requested in the processing request is stored in buffer storage means for temporarily storing data read from the storage unit, the first read step of reading the match data from the buffer storage means based on the determination result at the determination step, the second read step of reading an unread data piece of the data pieces requested in the processing request into the buffer storage means from the storage unit after termination of the first read step, and the third read step of reading the data piece read at the second read step from the buffer storage means.
The recording medium records the program for causing the computer to further execute the first transmission step, wherein processing is started between the first and second read steps, of transmitting the data read at the first read step to the requesting party making the processing request, and the second transmission step of transmitting the data read at the third read step to the requesting party.
According to the invention, there is provided a recording medium recording a program for causing a computer to execute the acceptance step of accepting a plurality of processing requests, the first storage step of reading common data to the processing requests from a storage unit and storing the common data in buffer storage means for temporarily storing data, the fourth read step at which a first task for processing one of the processing requests reads the common data stored at the first storage step from the buffer storage means, the fifth read step at which a second task for processing one of the processing requests reads the common data stored at the first storage step from the buffer storage means, and the sixth read step being executed after termination of the first storage step, of sensing whether or not the fourth and fifth read steps terminate, if the fourth and fifth read steps terminate, the sixth read step of reading data from the storage unit and substituting the data read from the storage unit for the common data stored in the area of the buffer storage area, if the fourth and fifth read steps do not terminate, the sixth read step of temporarily stopping the substituting of the data.
The acceptance step comprises the first acceptance step of accepting a first processing request as one of the processing requests, the first request step of making a request for reading data related to the first processing request accepted at the first acceptance step, the second acceptance step being executed after the first acceptance step, of accepting a second processing request as one of the processing requests, and the second request step of making a request for reading a data piece of a plurality of data pieces related to the second processing request accepted at the second acceptance step, not matching the data related to the first processing request, and the sixth read step includes reading the data requested at the first and second request steps into the buffer storage means from the storage unit.
According to the invention, there is provided a recording medium recording a program for causing a computer to execute the first acceptance step of accepting a first processing request for requesting data, the seventh read step of reading data related to the first processing request into buffer storage means from a disk unit, the second acceptance step of accepting a second processing request for requesting data during execution of the seventh read step, the comparison step being executed after the second acceptance step, of comparing the data amount involved in the first processing request with that in the second processing request in magnitude, the eighth read step of interrupting the seventh read step, reading data related to the second processing request from the disk unit, and transmitting the read data to the requesting party making the second processing request if the data amount involved in the second processing request is smaller than that in the first processing request based on the comparison result at the comparison step, and the ninth read step being executed after termination of the eighth read step, of restarting execution of the seventh read step interrupted.
The second processing request is a processing request for accessing a plurality of files, the comparison step includes sorting a file related to the first processing request and the files related to the second processing request according to the access order in the ascending order of file sizes of the files, the eighth read step includes reading the files related to the second processing request into the buffer storage means from the disk unit in accordance with the access order and transmitting data in the read files to the requesting party, and even if the eighth read step is not yet complete, if the eighth read step accesses a file common to the first processing request, the ninth read step reads data in the common file from the buffer storage means.
At the eighth read step, an unprocessed block of a plurality of blocks in the common file is read taking precedence over other blocks into the buffer storage means from the disk unit by a task for processing the first processing request and then a block unprocessed for the second processing request is read into the buffer storage means from the disk unit.